home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-09-28 | 5.6 KB | 190 lines |
- '***************************
- '* AMOS Professional *
- '* *
- '* MENUS 8 *
- '* * MENUS AND BANKS
- '* (c) Europress Software *
- '* *
- '* Ronnie Simpson *
- '***************************
- '
- '-------------------------------------------
- 'GENERAL
- '-------------------------------------------
- 'An entire menu definition may be saved to a bank which will be saved along
- 'with your program, this will reduce the listing size of the program as the
- 'coding for the menu set-up can be deleted as it is no longer required.
- '
- '-------------------------------------------
- 'Menu To Bank
- '-------------------------------------------
- 'save a menu definition to a bank
- '
- 'eg. Menu To Bank 7 (save to bank number 7)
- '
- 'If the bank number stated already exists then an error will be reported.
- '
- '-------------------------------------------
- 'Bank To Menu
- '-------------------------------------------
- 'restore a menu definition from a bank
- '
- 'eg. Bank To Menu 6 (restore from bank number 6)
- '
- 'The menu is restored in its original form and if the menu is large then
- 'this may take a little time to set up.
- 'The menu will be activated when the Menu On instruction is used.
- '
- '-------------------------------------------
- 'Menu Calc
- '-------------------------------------------
- 'recalculate a menu
- '
- 'If any new items are added to a menu (or old ones deleted or replaced) the
- 'menu will be automatically sorted out the next time the right mouse button
- 'is pressed.
- 'If the menu is large then this will take a little time, Menu Calc allows
- 'this to be performed at the most appropriate point to avoid any delays.
- 'To avoid any corruption of the menu while it is being updated it is best
- 'if the menu is switched off while the recalculation takes place.
- '
- 'eg Menu Off (freeze menu)
- ' Menu Calc (recalculate menu)
- ' Menu On (re-activate menu)
- '
- '-------------------------------------------
- 'WORKING EXAMPLE
- '-------------------------------------------
- '
- ' The following program defines a menu which is then saved to a bank, this
- ' menu bank will be used in the final tutorial of this section showing an
- ' example of a full menu in operation.
- '
- '-------------------------------------------
- Rem *** tidy up the screen
- '
- Screen Open 0,320,200,32,Lowres
- Load "AMOSPro_Tutorial:Objects/Menu_Bobs.Abk"
- '
- Palette 0,$AC
- Flash Off : Curs Off : Cls 0 : Pen 0 : Paper 1
- '
- Rem *** set the menu titles
- '
- Menu Static 1
- Menu$(1)="PICTURE ","(IN1,2)(SS4)PICTURE(SS0)"
- Menu$(2)="SELECT ","(IN1,2)(SS4)SELECT(SS0)"
- Menu$(3)="COLOURS ","(IN1,2)(SS4)COLOURS(SS0)"
- Menu$(4)="MODE ","(IN1,2)(SS4)MODE(SS0)"
- Menu$(5)="PATTERN ","(IN1,2)(SS4)PATTERN(SS0)"
- '
- Rem *** set the options
- '
- Paper 1
- Menu$(1,1)=" >>>LOAD IFF ","(IN1,2) LOAD IFF>>> "
- Menu$(1,2)=" <<<SAVE IFF ","(in1,2) SAVE IFF<<< "
- Menu$(1,3)=" clear ","(in1,2) CLEAR "
- Menu$(1,4)=" undo ","(in1,2) UNDO "
- Menu$(1,5)=" quit ","(in1,2) QUIT "
- '
- Paper 1
- Menu$(2,1)=" FOREGROUND COLOUR "
- Menu$(2,2)=" BACKGROUND COLOUR "
- Menu$(2,3)=" OUTLINE ON "
- Menu$(2,4)=" OUTLINE OFF "
- Menu$(2,5)=" OUTLINE COL "
- Menu$(2,5,1)=" OUTLINE COL "
- Paper 1
- For N=0 To 15
- Pen N : Menu$(2,5,N+1)=" ","(IN1,0)>> <<"
- Next
- '
- Menu Separate 2
- Paper 1
- For N=0 To 31
- Pen N : Menu$(3,N+1)=" ","(IN1,0)>> <<"
- Next
- Menu Link 2
- '
- Paper 1 : Pen 0
- Menu$(4,1)=" FREEHAND(LO 78,0)(BO2)","(LO 78,0)(BO10)"
- Menu$(4,2)=" LINE (LO 78,0)(BO3)","(LO 78,0)(BO11)"
- Menu$(4,3)=" TEXT (LO 78,0)(BO4)","(LO 78,0)(BO12)"
- Menu$(4,4)=" CIRCLE (LO 78,0)(BO5)","(LO 78,0)(BO13)"
- Menu$(4,5)=" ELLIPSE (LO 78,0)(BO6)","(LO 78,0)(BO14)"
- Menu$(4,6)=" BOX (LO 78,0)(BO7)","(LO 78,0)(BO15)"
- Menu$(4,7)=" BAR (LO 78,0)(BO8)","(LO 78,0)(BO16)"
- Menu$(4,8)=" PAINT (LO 78,0)(BO9)","(LO 78,0)(BO17)"
- '
- Paper 1 : Pen 0
- Menu$(5,1)=" PATTERN FILL ON "
- Menu$(5,2)=" PATTERN FILL OFF "
- Menu$(5,3)=" SELLECT FILL PATTERN "
- Pen 0 : Paper 1
- Menu$(5,3,1)="(PA1)(BA 30,15)"
- Menu$(5,3,2)="(PA2)(BA 30,15)"
- Menu$(5,3,3)="(PA3)(BA 30,15)"
- Menu$(5,3,4)="(PA4)(BA 30,15)"
- Menu$(5,3,5)="(PA5)(BA 30,15)"
- Menu$(5,3,6)="(PA6)(BA 30,15)"
- Menu$(5,3,7)="(PA7)(BA 30,15)"
- Menu$(5,3,8)="(PA8)(BA 30,15)"
- Menu$(5,3,9)="(PA9)(BA 30,15)"
- Menu$(5,3,10)="(PA10)(BA 30,15)"
- Menu$(5,3,11)="(PA11)(BA 30,15)"
- Menu$(5,3,12)="(PA12)(BA 30,15)"
- Menu$(5,3,13)="(PA13)(BA 30,15)"
- Menu$(5,3,14)="(PA14)(BA 30,15)"
- Menu$(5,3,15)="(PA15)(BA 30,15)"
- Menu$(5,3,16)="(PA16)(BA 30,15)"
- Menu$(5,3,17)="(PA17)(BA 30,15)"
- Menu$(5,3,18)="(PA18)(BA 30,15)"
- Menu$(5,3,19)="(PA19)(BA 30,15)"
- Menu$(5,3,20)="(PA20)(BA 30,15)"
- Menu$(5,3,21)="(PA21)(BA 30,15)"
- Menu$(5,3,22)="(PA22)(BA 30,15)"
- Menu$(5,3,23)="(PA23)(BA 30,15)"
- Menu$(5,3,24)="(PA24)(BA 30,15)"
- Menu$(5,3,25)="(PA25)(BA 30,15)"
- Menu$(5,3,26)="(PA26)(BA 30,15)"
- Menu$(5,3,27)="(PA27)(BA 30,15)"
- Menu$(5,3,28)="(PA28)(BA 30,15)"
- Menu$(5,3,29)="(PA29)(BA 30,15)"
- Menu$(5,3,30)="(PA30)(BA 30,15)"
- Menu$(5,3,31)="(PA31)(BA 30,15)"
- Menu$(5,3,32)="(PA32)(BA 30,15)"
- '
- Set Menu(5,3,1) To 20,14
- Set Menu(5,3,9) To 32,-112
- Set Menu(5,3,17) To 32,-112
- Set Menu(5,3,25) To 32,-112
- Set Menu(1,1) To 0,13
- Set Menu(2,1) To -14,13
- Set Menu(3,1) To -16,13
- Set Menu(3,17) To 18,-150
- Set Menu(4,1) To -38,13
- Set Menu(5,1) To -116,13
- Erase 6
- Menu To Bank 6
- '
- Rem *** start the automatic checking
- '
- Menu On
- On Menu Proc CONTROL
- On Menu On
- Pen 3 : Paper 0 : Locate 0,13 : Centre "PRESS RIGHT MOUSE KEY TO SEE MENU"
- Pen 5 : Locate 0,17 : Centre "P.S.- the quit works!"
- '
- Rem *** loop whilst waiting for menu
- '
- Do
- Loop
- '
- Procedure CONTROL
- C=Choice(2)
- If C=5
- Edit
- End If
- On Menu On
- End Proc
- '